# FindGTEST
# --------
#
# Find the GTEST libraries
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# The following variables will be defined:
#
# ``GTEST_FOUND`` True if GTEST found on the local system
#
# ``GTEST_INCLUDE_DIRS`` Location of GTEST header files
#
# ``GTEST_LIBRARY_DIRS`` Location of GTEST libraries
#
# ``GTEST_LIBRARIES`` List of the GTEST libraries found

include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake)

find_package(PkgConfig)
set(GTEST_INCLUDE_DIRS D://library//googletest//include )
#list(APPEND GTest_INCLUDE_DIRS G://Git//GTEST//include/GL)
#list(APPEND GTest_INCLUDE_DIRS G://Git//GTEST//include/GL3)
#list(APPEND GTest_INCLUDE_DIRS G://Git//GTEST//include/GLFW)
#list(APPEND GTest_INCLUDE_DIRS G://Git//GTEST//include/Shapes)

message(STATUS "FindGoogleTest.cmake")

#set(GTEST_LIBRARY_DIRS D://library//googletest//lib//Debug CACHE STRING "")
set(GTEST_LIBRARY D://library//googletest//lib//Debug//gtestd.lib)
#list(APPEND GTEST_LIBRARY D://library//googletest//lib//Debug//gmock_maind.lib)
list(APPEND GTEST_LIBRARY D://library//googletest//lib//Debug//gtestd.lib)
set(GTEST_MAIN_LIBRARY D://library//googletest//lib//Debug//gtest_maind.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//glew32.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//glut.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//glut32.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//*.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//vermilion.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//freeglut_staticd.lib)
#list(APPEND GTEST_LIBRARIES G://Git//GTEST//lib//freeglutd.lib)

# Getting the item of index in list.
#list(GET GTEST_LIBRARIES 2 glut3d)
message(STATUS "+++++++++++++++${GTEST_LIBRARY}+++++++++++++")

# list之后每个item都用分号隔开。
# 从GTEST_LIBRARIES中删除“G://Git//GTEST//lib//*.lib”
#list(REMOVE_ITEM GTest_LIBRARIES value G://Git//GTEST//lib//*.lib)

find_package_handle_standard_args(GTEST REQUIRED_VARS GTEST_LIBRARY GTEST_LIBRARY_DIRS GTEST_INCLUDE_DIRS)
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARY)
set(GTEST_FOUND true)
message(STATUS "1111111111111111===========${GTEST_LIBRARY}================")